package com.project.controller;


import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.project.entity.UserOrderEntity;
import com.project.entity.UserOrderInfoProductEntity;
import com.project.service.IUserOrderService;
import com.project.vo.UserOrderVo;
import com.rabbitmq.client.Channel;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.messaging.handler.annotation.Header;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;

@RestController
@RequestMapping("UserOrder")
public class UserOrderController {

    @Autowired
    private IUserOrderService service;



    @RequestMapping("findByItem")
    public IPage<UserOrderVo> findByItem(int pageNO, int status, int pageSize) {
        return service.findByItem(pageNO,status,pageSize);
    }

    @RequestMapping("findById")
    public List<UserOrderInfoProductEntity> findById(String customerId) {
        return service.findById(customerId);
    }
}
